#include "qscriptproperty.h"

#include "../../libs/sharedLib/qbtneditorlabel.h"

QScriptProperty::QScriptProperty(SHAREDLIB::QAbstractProperty *parent):
    SHAREDLIB::QAbstractProperty(parent)
{
    this->setAttribute("reset",false);
}

void QScriptProperty::valueXML(QXmlStreamWriter *w)
{
    w->writeAttribute("value",getValue().toString());
}

QWidget* QScriptProperty::getEditor()
{
    if(attribute("editabled").toBool())
    {
        m_editor=new SHAREDLIB::QBtnEditorLabel(this);
    }
    return QAbstractProperty::getEditor();
}

QString QScriptProperty::valueText()
{
    QString str=getValue().toString();
    str.replace("\r\n"," ");
    str.replace("\n"," ");
    return str;
}
